#define _CRT_SECURE_NO_WARNINGS	

#include<stdio.h>
#include<math.h>
double dis;
int time;

double ret()
{
    double sum = 0;
    if (dis <= 3)
        sum = 10;
    else if (dis <= 13)
        sum = 10 + (dis - 3) * 2;
    else
        sum = 10 + 20 + (dis - 13) * 3;
    sum += time / 5*2;
    return sum;
}

int main()
{
    scanf("%lf%d", &dis, &time);
    printf("%d", (int)round(ret()));
    return 0;
}